package com.example.dllo.my36kr.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;


import java.util.ArrayList;

/**
 * 股权投资界面tabLayout + ViewPager的适配器
 * Created by CPC_272 on 16/8/16.
 */
public class InvestTabAdapter extends FragmentPagerAdapter {
    private ArrayList<Fragment>data;
    //把文字放到集合里
   private  ArrayList<String>title;
    public InvestTabAdapter(FragmentManager fm, ArrayList<Fragment> data) {
        super(fm);
        this.data = data;
        title=new ArrayList<>();
        title.add("全部");
        title.add("募资中");
        title.add("募资完成");
        title.add("融资成功");
    }


    @Override
    public Fragment getItem(int position) {
        return data.get(position);
    }

    @Override
    public int getCount() {
        return data!=null?data.size():0;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return  title.get(position);
    }
}
